/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package pe.com.minam.daorepository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import pe.com.minam.beans.InfoLugar;

/**
 *
 * @author Willian
 */
@Repository
public interface InfoLugarDao extends JpaRepository<InfoLugar,Integer> {
    
    @Query(
            value ="SELECT c from InfoLugar c where c.lugar.id = :lugar",
            countQuery = "SELECT count(c) from InfoLugar c where c.lugar.id = :lugar"
    )
    Page<InfoLugar> getPorLugar(@Param("lugar") Integer lugar,Pageable pageable);
}
